package com.yi.servicedriveruser.controller;


import com.yi.internalcommon.dto.DriverCarBindingRelationship;
import com.yi.internalcommon.dto.ResponseResult;
import com.yi.servicedriveruser.service.DriverCarBindingRelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 田毅
 * @since 2022-08-16
 */
@RestController
@RequestMapping("/driver-car-binding-relationship")
public class DriverCarBindingRelationshipController {
    @Autowired
    DriverCarBindingRelationshipService driverCarBindingRelationshipService;
    /**
     * 司机车辆绑定
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping("/bind")
    public ResponseResult binds(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){

        return driverCarBindingRelationshipService.bind(driverCarBindingRelationship);
    }
    /**
     * 司机车辆解绑
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping ("/unbind")
    public ResponseResult unBinds(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){

        return driverCarBindingRelationshipService.unBind(driverCarBindingRelationship);
    }

}
